

<script src="/assets/style/js/jquery.js"></script>


<div class="content">
    <div class="panel panel-default panel-intro">
        <div class="panel-body">
            <div id="" class="tab-content">
                <div class="tab-pane fade active in" id="one">
                    <div class="widget-body no-padding">
                        <div class="bootstrap-table">
                            <div class="fixed-table-toolbar">
                                <form action="" method="post">
                                    <table id="" class="table table-striped table-bordered table-hover table-nowrap" data-operate-edit="1" data-operate-del="1" width="100%">
                                        <thead>

                                        <tr>
                                            <th class="bs-checkbox " style="text-align: center; vertical-align: middle;width:3%;height: 45px;" data-field="0">金额

                                            </th>
                                            <th style="text-align: center; vertical-align: middle;width:4.5%;" data-field="fid">
                                               说明
                                            </th>

                                            <th style="text-align: center; vertical-align: middle;width:4.5%;" data-field="fid">
                                               操作者用户名
                                            </th>
                                            <th style="text-align: center; vertical-align: middle;width:4.5%;" data-field="fid">
                                               增加或减少
                                            </th>
                                            <th style="text-align: center; vertical-align: middle;width: 20%;" data-field="operate">
                                                <div class="th-inner ">操作</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody data-listidx="0">
                                        {volist name="supplement" id="vo"}
                                        <tr data-index="0">

                                            <td style="text-align: center; vertical-align: middle; ">
                                                {$vo.tatolprice}
                                            </td>
                                            <td style="text-align: center; vertical-align: middle; ">
                                                {$vo.title}
                                            </td>
                                            <td style="text-align: center; vertical-align: middle; ">
                                                {$vo.username}
                                            </td>
                                            <td style="text-align: center; vertical-align: middle; ">
                                                {if condition="$vo.paytype eq 0"}
                                                增加订单金额
                                                {/if}
                                                {if condition="$vo.paytype eq 1"}
                                                减少订单金额
                                                {/if}
                                            </td>
                                            <td style="text-align: center; vertical-align: middle; ">
                                                <a href="/admin/order/order_reduced?action=del&orderid={$vo.order_id}&supplementid={$vo.id}&tatolprice={$vo.tatolprice}&paytype={$vo.paytype}" class="btn btn-success btn-edit btn-disabled" title="编辑"><i class="fa fa-pencil"></i> 删除（回收）订单</a>
                                            </td>
                                        </tr>
                                        {/volist}
                                        </tbody>
                                    </table>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<form method="post" action="/admin/order/order_reduced">
    <input type="hidden" name="action" value="add">
    <input  type="hidden" name="orderid" value="{$orderid}">
    <br>
    金额<input id="tatolpriceinput" type="text" name="tatolprice" value=""/><br/>
    操作   <input type="radio" name="paytype" value="1" checked="checked">减少订单金额（优惠）
          <input type="radio" name="paytype" value="0">增加订单金额（补交）<br/>
    说明  <input type="text" name="title" value=""><br/>
    详情<textarea name="remark"></textarea><br/>
<input type="submit" value="提交"/>
</form>



<script>
    function sliptList(obj,id){
        var installment=$(obj).prev("input[name='installment']").val();
        //alert(installment);
        if(installment<1){
            layer.alert("数据不合法！");
            return;
        }
        window.location.href="/admin/order/split_index?id="+id+"&installment="+installment;
    }

    function claim(id){
        $.ajax({
            type:'post',
            dataType:'json',
            data:{"id":id},
            url:"/admin/order/claim",
            success:function(data){
                if(data.status==1){
                    layer.alert(data.message,
                        {closeBtn:0},
                        function(){
                            window.location.reload();
                        })
                }else{
                    layer.alert(data.message);
                }
            }
        })

    }


    /*JQuery 限制文本框只能输入数字*/
    $("#tatolpriceinput").keyup(function(){
        alert
        $(this).val($(this).val().replace(/[^\d]/g,''));
    }).bind("paste",function(){  //CTR+V事件处理
        $(this).val($(this).val().replace(/[^\d]/g,''));
    }).css("ime-mode", "disabled"); //CSS设置输入法不可用
</script>
